package com.hubei.car.controller;

import com.hubei.car.annotation.PostApi;
import com.hubei.car.entity.Result;
import com.hubei.car.service.CompanyPropertyService;
import com.hubei.car.service.MsNewsService;
import com.hubei.car.swaggerParam.MsNewsQueryParam;
import com.hubei.car.swaggerParam.MsNewsQueryParam2;
import com.hubei.car.swaggerParam.MsNewsTypeQueryParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 资讯接口
 * @author huanghaisheng
 * @create 2019-11-23
 */
@RestController
@Api(value = "资讯接口",tags = "资讯接口")
@RequestMapping("/msNews")
public class MsNewsController {
    @Autowired
    private MsNewsService msNewsService;
    @Autowired
    private CompanyPropertyService companyPropertyService;

    @PostApi(value = "/queryMsNewsTypePage", auth = false)
    @ApiOperation("资讯分类查询")
    public Result queryMsNewsTypePage(@RequestBody @Valid MsNewsTypeQueryParam msNewsTypeQueryParam){
        return msNewsService.queryMsNewsTypePage(msNewsTypeQueryParam);
    }

    @PostApi(value = "/queryMsNewsPage", auth = false)
    @ApiOperation("资讯查询(多条件)")
    public Result queryMsNewsPage(@RequestBody @Valid MsNewsQueryParam msNewsQueryParam){
        return msNewsService.queryMsNewsPage(msNewsQueryParam);
    }

    @PostApi(value = "/queryMsNewsPage2", auth = false)
    @ApiOperation("资讯查询")
    public Result queryMsNewsPage2(@RequestBody @Valid MsNewsQueryParam2 msNewsQueryParam2){
        return msNewsService.queryMsNewsPage2(msNewsQueryParam2);
    }

    @PostApi(value = "/queryAllMsNewsTypePage", auth = false)
    @ApiOperation("资讯分类查询所有")
    public Result queryAllMsNewsTypePage(){
        return msNewsService.queryAllMsNewsTypePage();
    }

    @PostApi(value = "/queryOneCompanyProperty", auth = false)
    @ApiOperation("公司介绍")
    public Result queryOneCompanyProperty(){
        return companyPropertyService.queryOneCompanyProperty();
    }

}
